package com.example.demo_01.controller;

import com.example.demo_01.service.RoomService;
import com.example.demo_01.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.Map;

@RestController
@RequestMapping("/RoomController")
public class RoomController {

    @Autowired
    private RoomService roomService;

    @RequestMapping("/findByParam")
    public ResultBean findByParam(@RequestParam Map<String, String> param) {
        return roomService.findByParam(param);
    }

    @RequestMapping("/save")
    public ResultBean save(@RequestParam Map<String, String> param) {
        return roomService.doSave(param);
    }

    @RequestMapping("/update")
    public ResultBean update(@RequestParam Map<String, String> param) {
        return roomService.doUpdate(param);
    }

    @RequestMapping("/delete")
    public ResultBean delete(String ids) {
        return roomService.delete(ids);
    }
}
